import React from 'react';
import { Tooltip } from 'antd';
import CommonList from '../../../components/CommonLists/list';

class RouteList extends CommonList {
  constructor(props) {
    super(props);
    this.api = 'route';
    this.tableParams = {
      pagination: {
        showQuickJumper: true,
        total: props.list.length,
        showTotal: (total) => {
          return `总共 ${total} 条`;
        },
        showSizeChanger: true,
        pageSizeOptions: ['5', '10', '15', '20']
      }
    }
  }
  componentDidMount() {}
  getColumn = () => {
    return [
      {
        title: '路径',
        key: 'name',
        dataIndex: 'name',
        render: (text, record) => {
          return (
            <Tooltip title={text} placement='topLeft'>
              {text}
            </Tooltip>
          );
        }
      },
      {
        title: '备注',
        dataIndex: 'remark',
        key: 'remark',
        render: (text, record) => {
          return (
            <Tooltip title={text} placement='topLeft'>
              {text}
            </Tooltip>
          );
        }
      },
      {
        title: '创建人',
        dataIndex: 'create_by',
        key: 'create_by',
        render: (text, record) => {
          return (
            <Tooltip title={text} placement='topLeft'>
              {text}
            </Tooltip>
          );
        }
      },
      {
        title: '创建时间',
        dataIndex: 'create_at',
        key: 'create_at',
        render: (text, record) => {
          return (
            <Tooltip title={text} placement='topLeft'>
              {text}
            </Tooltip>
          );
        }
      },
      {
        title: '修改人',
        dataIndex: 'update_by',
        key: 'update_by',
        render: (text, record) => {
          return (
            <Tooltip title={text} placement='topLeft'>
              {text}
            </Tooltip>
          );
        }
      },
      {
        title: '修改时间',
        dataIndex: 'update_at',
        key: 'update_at',
        render: (text, record) => {
          return (
            <Tooltip title={text} placement='topLeft'>
              {text}
            </Tooltip>
          );
        }
      }
    ];
  };
}

export default RouteList;
